import request from '@/utils/request'

export const baseUrl = '/system/oss'
export const baseApiName = '文件存储'

export function upload(data) {
	return request({
		url: `${baseUrl}/upload`,
		method: 'post',
		data,
		apiName: `${baseApiName}创建`
	})
}
export function createFolder(params) {
	return request({
		url: `${baseUrl}/createFolder`,
		method: 'get',
		params,
		apiName: `${baseApiName}创建文件夹`
	})
}

export function findAll(params) {
	return request({
		url: `${baseUrl}`,
		method: 'get',
		params,
		apiName: `${baseApiName}列表`
	})
}

export function findOne(id) {
	return request({
		url: `${baseUrl}/${id}`,
		method: 'get',
		apiName: `${baseApiName}更具id查询`
	})
}

export function update(id, data) {
	return request({
		url: `${baseUrl}/${id}`,
		method: 'patch',
		data,
		apiName: `${baseApiName}修改`
	})
}

export function remove(params) {
	return request({
		url: `${baseUrl}`,
		method: 'delete',
		params,
		apiName: `${baseApiName}删除`
	})
}


